#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	unordered_map<int, int> cnt;
	int n, x;
	cin >> n;
	while (n--) {
		cin >> x;
		cnt[x]++;
	}

	int ans = 0, t1 = 0, t2 = 0;
	for (auto i = cnt.begin(); i != cnt.end(); i++) {
		if (i->second > 2) {
			t1 += i->second - 2;
			i->second = 2;
		}
		if (i->second == 1)
			t2++;
	}
	if (t1 > t2)
		ans = t2 + (t1 - t2);
	else
		ans = t1 + (t2 - t1) / 2;
	cout << ans;
	return 0;
}
